package com.xiaoxx.coin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum CurrencyTypeEnum {
    USDT("USDT", "泰币"),
    BTC("BTC", "比特币"),
    ETH("ETH", "以太坊"),
    EOS("EOS", "柚子"),
    BCH("BCH", "比特现金"),
    LTC("LTC", "莱特币"),
    TRX("TRX", "TRON"),
    XRP("XRP", "瑞波币"),;

    private String code;
    private String name;

    public static CurrencyTypeEnum getByCode(String code) {
        for (CurrencyTypeEnum type : CurrencyTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
